<script type="text/javascript">
	$(document).ready(function(){				
	
		$('#file_upload').uploadify({
			'buttonText'        : 'UPLOAD VIDEO',
			'checkExisting'     : '<?php echo base_url() ?>assets/lib/uploadify/check-exists.php',
			'fileSizeLimit'     : '100MB',
			'fileTypeDesc'      : 'Video Files',		
			'fileTypeExts'      : '*.flv; *.mp4; *.mpg; *.mpeg; *.wmv; *.FLV; *.MP4; *.MPG; *.MPEG; *.WMV;', 
			'swf'      : '<?php echo base_url() ?>assets/lib/uploadify/uploadify.swf',
			'uploader' : '<?php echo base_url() ?>users/upload_video/<?php echo $this->session->userdata('intID'); ?>',
			'onSelect'          : function() { 
									if(trim(txt_title.value)=="")
									{
										alert("Please enter video name.");
										txt_title.focus();
										$('#file_upload').uploadify('cancel'); 
										return false;
									}
								  },
			'onSelectError'     : function() { alert('The file returned an error and was not added to the queue.');},
			'onUploadStart'     : function() { $("#file_upload").uploadify('settings', 'formData', {'txt_title':  $('#txt_title').val()}); },
			'onUploadComplete'  : function() { document.location='' }
			// Put your options here
		});
		
		$('#image_upload').uploadify({
			'buttonText'        : 'UPLOAD PICTURE',
			'checkExisting'     : '<?php echo base_url() ?>assets/lib/uploadify/check-exists.php',
			'fileSizeLimit'     : '100MB',
			'fileTypeDesc'      : 'Video Files',		
			'fileTypeExts'      : '*.jpg; *.gif; *.png;', 
			'swf'      : '<?php echo base_url() ?>assets/lib/uploadify/uploadify.swf',
			'uploader' : '<?php echo base_url() ?>users/upload_image/<?php echo $this->session->userdata('intID'); ?>',
			'onSelect'          : function() { 
									if(trim(txt_title.value)=="")
									{
										alert("Please enter video name.");
										txt_title.focus();
										$('#file_upload').uploadify('cancel'); 
										return false;
									}
								  },
			'onSelectError'     : function() { alert('The file returned an error and was not added to the queue.');},
			'onUploadStart'     : function() { $("#file_upload").uploadify('settings', 'formData', {'txt_title':  $('#txt_title').val()}); },
			'onUploadComplete'  : function() { document.location='' }
			// Put your options here
		});
	});	
</script>